#include"main.hpp"

void deletestu()
{
	int a;
	student stu[MAX];
	FILE *istufile;
	FILE *ostufile;
	if((istufile = fopen ("stugrd.txt", "rb"))==NULL)
    {
        printf("出现错误，代码：FILEERROR");
    }
    fread(stu,sizeof(struct student),MAX,istufile);
    fclose(istufile);
    printf("请输入您要删除的学生内部编号：\n");
    cin >> a;
    stu[a].state=0;
    if((ostufile = fopen ("stugrd.txt", "wb"))==NULL)
    {
        printf("出现错误，代码：FILEERROR");
    }
    fwrite(stu,sizeof(struct student),MAX,ostufile);
    fclose(ostufile);
    printf("删除成功！\n");
}
